/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.ana.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lucas.nunes
 */
@Entity
@Table(name = "QLTTB_STATUS_REGISTRO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusRegistro.findAll", query = "SELECT s FROM StatusRegistro s"),
    @NamedQuery(name = "StatusRegistro.findByStrId", query = "SELECT s FROM StatusRegistro s WHERE s.strId = :strId"),
    @NamedQuery(name = "StatusRegistro.findByStrNm", query = "SELECT s FROM StatusRegistro s WHERE s.strNm = :strNm"),
    @NamedQuery(name = "StatusRegistro.findByStrDs", query = "SELECT s FROM StatusRegistro s WHERE s.strDs = :strDs")})
public class StatusRegistro implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "STR_ID")
    private BigDecimal strId;
    @Size(max = 104)
    @Column(name = "STR_NM")
    private String strNm;
    @Size(max = 4000)
    @Column(name = "STR_DS")
    private String strDs;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estStrId")
    private List<Estacao> estacaoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "mdhStrId")
    private List<MedHidrometeorologica> medHidrometeorologicaList;

    public StatusRegistro() {
    }

    public StatusRegistro(BigDecimal strId) {
        this.strId = strId;
    }

    public BigDecimal getStrId() {
        return strId;
    }

    public void setStrId(BigDecimal strId) {
        this.strId = strId;
    }

    public String getStrNm() {
        return strNm;
    }

    public void setStrNm(String strNm) {
        this.strNm = strNm;
    }

    public String getStrDs() {
        return strDs;
    }

    public void setStrDs(String strDs) {
        this.strDs = strDs;
    }

    @XmlTransient
    public List<Estacao> getEstacaoList() {
        return estacaoList;
    }

    public void setEstacaoList(List<Estacao> estacaoList) {
        this.estacaoList = estacaoList;
    }

    @XmlTransient
    public List<MedHidrometeorologica> getMedHidrometeorologicaList() {
        return medHidrometeorologicaList;
    }

    public void setMedHidrometeorologicaList(List<MedHidrometeorologica> medHidrometeorologicaList) {
        this.medHidrometeorologicaList = medHidrometeorologicaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (strId != null ? strId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusRegistro)) {
            return false;
        }
        StatusRegistro other = (StatusRegistro) object;
        if ((this.strId == null && other.strId != null) || (this.strId != null && !this.strId.equals(other.strId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.gov.ana.service.StatusRegistro[ strId=" + strId + " ]";
    }
    
}
